<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" errorPage="500.jsp"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
  <%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="../admin_css/hotFilmExhibition.css">
    <link rel="stylesheet" href="../admin_css/iconfont/iconfont.css">
    <script type="text/javascript" src="../js/jquery-1.12.4.js"></script>
</head>
<body>
<div class="content">
    <div class="container" style="padding: 0px;width: 100% ;">
    <div class="tou"><span class="iconfont icon-dianying1"></span><span style="font-weight: bold; margin-left: 6px;">电影类型管理</span></div>
    <table class="table" >
        <caption><span id="sum" style="margin-left: 30px;">共${sessionScope.adminFilmTypesSize}条</span></caption>
        <thead>
        <tr>
            <th>编号</th>
            <th>类型</th>
            <th>操作</th>
           
        </tr>
        </thead>
        <tbody id="table">
        	<c:forEach items="${sessionScope.adminFilmTypes }"  begin="0" end="6"  var="adminFilmType">
        			<tr>
		                <td id="filmId1" class="typeId">${adminFilmType.typeId}</td>
		                <td id="filmName1">${adminFilmType.typeName}</td>
		                 <td>
		                    <button id="but6" type="button" class="btn btn-default" style="border:1px solid red;"><span>删除</span></button>
		                </td>
           			 </tr>
        
        	</c:forEach>
        
        </tbody>
    </table>
    <!--分页-->
    <div id="fenye" class="panel-footer" style="text-align: center; display: block;">
        <nav style="height: 35px;">
            <ul class="pagination" style="margin-top:0px;">
                <li id="Previous" class="disabled" style="cursor: pointer;" flag="">
                      <span aria-hidden="true">«</span>    
                </li>

              
                <c:forEach items="${sessionScope.adminFilmType}"  begin="0" end="${sessionScope.adminFilmTypesSize<=7?0:(sessionScope.adminFilmTypesSize/7)}" varStatus="temp">
                	   <li flag="${temp.count}" class="${param.flag == temp.count?'active':'' } data"><a href="${pageContext.request.contextPath}/filmTypePage.do?page=${temp.count}&isDelete=0">${temp.count }</a></li>
                </c:forEach>
                
                
                <li id="li" style="cursor: pointer;">             
                      <span aria-hidden="true">»</span>
                </li>
            </ul>
        </nav>
        <div class="clearfix"></div>
    </div>
    <!--添加弹出框 -->
    <div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"  >
        <div class="modal-dialog" >
            <div class="modal-content" style="width:500px;height:400px;margin:auto;">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel" style="text-align: center;">电影信息添加</h4>
                      <span class="close"  >X</span>
                </div>
                <form action="${pageContext.request.contextPath}/addType.do"  onsubmit="return checkForm()" method="post">
	                <div class="text-center" style="margin-top: 15px; text-align: center;">
	                    <div class="form-group" style="margin-left:-20px;">
	                          <label for="firstname" class="col-sm-3 control-label">电影名称</label>
	                        <div class="">
	                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="typeName">
	                        </div>
	                    </div>
	                     
	                </div>
	                <div class="modal-footer" style="text-align: center;">
	                    <button id="btn3" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
	                    <input id="but4" type="submit" class="btn btn-danger" data-dismiss="modal" value="添加">
	                </div>
                </form>
                
            </div>
            <!-- /.modal-content -->
        </div>
       		
    </div>
    <div align="center" style="margin-bottom: 10px;padding-top: 10px; border-top: 1px solid #b3a6a6;">
        <button id="but2" type="button" class="btn btn-success" data-toggle="modal" data-target="#add" style=" width: 100px; height: 40px; line-height: 30px;">
            <span  style="margin-right: 6px; color:white; font-size: 16px;">√</span>
            <span style="color:white; font-weight: 800;font-size: 16px;">添加</span>
        </button>
    </div>
</div>

</div>
	<c:if test="${sessionScope.typeMsg != null}">
		<script>
			alert('该类型有电影绑定，暂时删除不了')
		</script>
	</c:if>
	<c:remove var="typeMsg" scope="session"/>
	<c:if test="${sessionScope.addTypeResultMsg != null}">
		<script>
			alert('当前类型已经存在了喔~')
		</script>
	</c:if>
	<c:remove var="addTypeResultMsg" scope="session"/>
</body>
<script type="text/javascript" src="../admin_js/filmTypeExhibition.js"></script>
</html>